package schoolsource.command;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author Steven Steele
 * Copyright 2003
 *
 * Sneds a simple response back to the client to indicate servlets are up and running.
 */
public class Pinger extends HttpServlet {


    /**
     * @see javax.servlet.http.HttpServlet#doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
     **/
    public void doPost(HttpServletRequest input, HttpServletResponse response)
        throws ServletException, IOException {

        // Set up request dispatcher to display the next page.
        ServletContext sc = getServletContext();
        RequestDispatcher disp;

        response.setContentType("text/html; charset=ISO-8859-2");
        disp = sc.getRequestDispatcher("/pinger.jsp");
        disp.include(input, response);
    }

    /**
     * Forwards all calls to doPost
     * @see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
     **/
    public void doGet(HttpServletRequest input, HttpServletResponse response)
        throws ServletException, IOException {

        doPost(input, response);

    }
}
